package com.ybear.ybutils.utils.dialog;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

public class Dialog {
    public static DialogConfig with(Context context, @StyleRes int themeResId) {
        return new DialogConfig( context, themeResId );
    }
    public static DialogConfig with(Context context) {
        return with( context, 0 );
    }

    public static DialogConfig with(@NonNull View v, @StyleRes int themeResId) {
        return with( v.getContext(), themeResId );
    }
    public static DialogConfig with(@NonNull View v) {
        return with( v, 0 );
    }

    public static DialogConfig with(@NonNull Fragment f, @StyleRes int themeResId) {
        return with( f.getContext(), themeResId );
    }
    public static DialogConfig with(@NonNull Fragment f) {
        return with( f, 0 );
    }

    @Deprecated
    public static DialogConfig with(@NonNull android.app.Fragment f, @StyleRes int themeResId) {
        return with( f.getActivity(), themeResId );
    }
    @Deprecated
    public static DialogConfig with(@NonNull android.app.Fragment f) {
        return with( f, 0 );
    }

    public static DialogInit getInit() { return DialogInit.get(); }
}